const net = require('net')

const client = net.createConnection({ port: 8888 }, function () {
  console.log('客户端已连接')
  console.log(`地址：${client.localAddress + ':' + client.localPort}`)
  client.write('Hello, I am client !')
})
client.on('data', data => {
  console.log(data.toString())
  // client.end()
})
client.on('end', () => {
  console.log('客户端断开连接')
})
client.on('error', e => {
  console.log(e)
})
